/*
 * @Author: 追逐的娃 kangchao_php@163.com
 * @Date: 2024-09-29 16:14:11
 * @LastEditors: 追逐的娃 kangchao_php@163.com
 * @LastEditTime: 2024-10-08 17:43:49
 * @FilePath: \vue-project\src\api\other.js
 * @Description: 
 * 
 */
import request from '@/utils/request.js'
/**
 * 获取协议
 * @param {*} page 页码 
 */
export const getAgreement = (page = 1) => {
    return request.get(`/agreement/${page}`)
}

/**
 * 添加/更新 协议
 * @param {*} data 
 */
export const saveAgreement = (data, id = '') => {
    let url = id ? `agreement/${id}/update` : '/agreement/save'
    return request.post(url, data)
}

/**
 * 删除单条协议
 * @param {*} id 
 */
export const deleteOneAgreement = (id) => {
    return request.post(`agreement/${id}/delete`)
}


/**
 * 获取轮播图列表
 * @param {*} page 
 */
export const getBanner = (page = 1) => {
    return request.get(`/banner/${page}`)
}

/**
 * 添加banner
 * @param {*} data 
 */
export const saveBanner = (data, id = "") => {
    let url = id ? `/banner/${id}/update` : `/banner/save`
    return request.post(url, data)
}